<template>
  <div class="code-container">
    <fks-tabs v-model="activeName" @tab-click="handleClick">
      <fks-tab-pane :label="LANG.OBJ_LIST" name="objList">
        <rule-list ref="ruleList"></rule-list>
      </fks-tab-pane>
      <fks-tab-pane :label="LANG.METACODE_LIB" name="codeLib">
        <code-list ref="codeList"></code-list>
      </fks-tab-pane>
    </fks-tabs>
  </div>
</template>
<script>
import CodeList from './CodeList'
import RuleList from './RuleList'
import Mix from '@/mixins/module'
export default {
  name: 'CodeRule',
  mixins: [Mix],
  components: {
    CodeList,
    RuleList
  },
  data() {
    return {
      activeName: 'objList'
    }
  },
  methods: {
    handleClick() {
      if (this.activeName == 'codeLib') {
        this.$refs.codeList.getCodeList()
      } else {
        this.$refs.ruleList.getObjList()
      }
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .fks-tabs {
  height: 100%;
}
::v-deep .fks-tabs__header {
  margin-bottom: 0;
}
::v-deep .fks-tabs__content {
  height: calc(100% - 40px);
}
::v-deep .fks-tab-pane {
  height: 100%;
}
.code-container {
  padding: 24px 32px;
}
</style>